﻿@model List<Core_Goods>
@{
    Layout = null;
    string sort = Request.QueryString["sort"];
    string od = Request.QueryString["od"];
    int cid = 0;

    if (ViewBag.Cid!=null)
    {
        cid = ViewBag.Cid;
    }
}
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta charset="utf-8">
    <title>花溆园艺植物商城</title>
    <link rel="stylesheet" href="\static\themes\xin\statics\css\ectouch.css">
</head>
<body style="max-width:640px;">
    <div id="loading"><img src="\static\themes\xin\statics\img\loading.gif"></div>
    <style>
        a.a-sequence {
            width: 3.5rem;
            height: 0rem;
            line-height: 3rem;
            margin-left: 0.5rem;
        }

        a.s-filter {
            line-height: 3rem;
            padding-left: 0rem;
        }
    </style>
    <div class="con">
        <div class="category">
            <section class="search">
                <div class="text-all dis-box j-text-all text-all-back">
                    <a class="a-icon-back j-close-search" href="javascript:history.go(-1)"><i class="iconfont icon-jiantou is-left-font"></i></a>
                    <div class="box-flex input-text n-input-text i-search-input">
                        <a class="a-search-input j-search-input" href="javascript:void(0)"></a>
                        <i class="iconfont icon-sousuo"></i>
                        <input class="j-input-text" type="text" placeholder="请输入您搜索的关键词!">
                        <i class="iconfont icon-guanbi1 is-null j-is-null"></i>
                    </div>
                    <a class="a-sequence j-a-sequence"><i class="iconfont icon-pailie" data="1"></i></a>
                </div>
            </section>
            <section class="product-sequence dis-box">
                <a class="box-flex @($"{((string.IsNullOrEmpty(sort) || sort == "0") ? "active" : "")}")" href="@($"/plants/index/?id={cid}")">默认</a>
                <a class="box-flex  @($"{(sort == "1" ? "active" : "")}") @($"{(od == "0" ? "a-change" : "")}")" href="@($"/plants/index/?id={cid}&sort=1&od={(od == "0" ? "1" : "0")}")">
                    销量
                    <i class="iconfont icon-xiajiantou"></i>
                </a>
                <a class="box-flex  @($"{(sort == "2" ? "active" : "")}") @($"{(od == "0" ? "a-change" : "")}")" href="@($"/plants/index/?id={cid}&sort=2&od={(od == "0" ? "1" : "0")}")">
                    人气
                    <i class="iconfont icon-xiajiantou"></i>
                </a>
                <a class="box-flex  @($"{(sort == "3" ? "active" : "")}") @($"{(od == "0" ? "a-change" : "")}")" href="@($"/plants/index/?id={cid}&sort=3&od={(od == "0" ? "1" : "0")}")">
                    价格<i class="iconfont icon-xiajiantou"></i>
                </a>
                <a href="#j-filter-div" class="box-flex s-filter j-s-filter" style="display:none;">筛选</a>
                <!--
                <a class="a-sequence j-a-sequence"><i class="iconfont icon-pailie" data="1"></i></a>-->
            </section>
            <!--
            -->
            <section class="product-list j-product-list product-list-medium" data="1">
                <ul id="j-product-box">
                    @if (!Model.Any())
                    {
                        <div class="no-div-message">
                            <i class="iconfont icon-biaoqingleiben"></i>
                            <p>亲，此处没有内容～！</p>
                        </div>
                    }
                    else
                    {
                        foreach (var item in Model)
                        {
                            <li>
                                <div class="product-div">
                                    <a class="product-div-link" href="/plants/show/@item.G_Id"></a>
                                    <img class="product-list-img" src="\static\themes\xin\statics\img\loading_shop.png" data-echo="@item.G_Img" alt="@item.G_Name">
                                    <div class="product-text">
                                        <h4>@item.G_Name</h4>
                                        <p class="dis-box p-t-remark">
                                            <span class="box-flex">库存：@item.G_RemainCount</span><span class="box-flex">销量：@item.G_Sales</span>
                                        </p>
                                        <p><span class="p-price t-first ">￥ @item.G_PriceDeposit.ToString("N") 元<small><del>￥@item.G_Price.ToString("N") 元</del></small></span></p>
                                        <a href="tel:15998994791" class="icon-flow-cart fr j-goods-attr"><i class="iconfont icon-gouwuche"></i></a>
                                    </div>
                                </div>
                            </li>
                        }
                    }
                </ul>
            </section>
        </div>
    </div>

    <div class="filter-top" id="scrollUp">
        <i class="iconfont icon-dingbu"></i>
    </div> 
    @{
        Html.RenderAction("PlantsFilter", "Main");
    }
    <div class="div-messages"></div>

    <script type="text/javascript" src="\static\themes\xin\statics\js\jquery-2.1.4.min.js"></script>
    <script type="text/javascript" src="\static\themes\xin\statics\js\swiper-3.2.5.min.js"></script>
    <script type="text/javascript" src="\static\themes\xin\statics\js\ectouch.js"></script>
    <script type="text/javascript" src="\static\themes\xin\statics\js\echo.min.js"></script>
    <script type="text/javascript">
       /*
       * 检测对象是否是空对象(不包含任何可读属性)。
       * 方法既检测对象本身的属性，也检测从原型继承的属性(因此没有使hasOwnProperty)。
       */
        function isEmpty(obj) {
            for (var name in obj) {
                return false;
            }
            return true;
        }
        echo.init();
    </script>
</body>
</html>